<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Load the needed libs which was defined by system or by user.
 *
 * @author waterfrog
 */
if(!defined('TinyFW')) exit('Access denied!');

class tfLoader {
    //put your code here
    
    private function __construct() { }

    public function __clone() { }

    public static function autoload($classname) {
        //load core library
        if(file_exists(SYS_PATH . DS . "core" . DS . $classname . ".php")) {
            include_once(SYS_PATH . DS . "core" . DS . $classname . ".php");
        }
        //load libs
        if(file_exists(SYS_PATH . DS . "libs" . DS . $classname . ".class.php")) {
            include_once(SYS_PATH . DS . "libs" . DS . $classname . ".class.php");
        }

        //autoload helpers
        if(file_exists(SYS_PATH . DS . "helpers" . DS . $classname . ".php")) {
            include_once(SYS_PATH . DS . "helpers" . DS . $classname . ".php");
        }
    }
    
    public static function autoloadRegister(){
        spl_autoload_register(array('tfLoader','autoload'));
    }

    public function loadLibrary($lib_name) {
        
    }

    public function loadModel($model_name) {

    }

    public function loadView($view_name) {
        
    }

    /*
    public static function load_core_library() {
        
    }
    */

}
?>
